<extend name="public@base5"/>
<block name="main">
    <div class="wrap js-check-wrap">
        <form action="admin/hooks/plugins/list/order" method="post" class="js-ajax-form">
            <php>
                $types = ["1"=>lang('System Hook'),'2'=>lang('App Hook'),'3'=>lang('Theme Hook'),'4'=>lang('Admin Theme Hook')];
                $status=array("1"=>lang('ENABLED'),"0"=>lang('DISABLED'),"3"=>lang('Not Installed'));
            </php>
            <div class="table-actions">
                <button type="submit" class="btn btn-primary btn-sm js-ajax-submit"
                        title="{:lang('Sort')}" data-toggle="tooltip">
                    <i class="fa fa-sort-numeric-asc fa-fw"></i>
                </button>
            </div>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th width="50">{:lang('Sort')}</th>
                    <th>{:lang('Name')}</th>
                    <th>{:lang('Key')}</th>
                    <th>{:lang('Hook')}</th>
                    <th>{:lang('Description')}</th>
                    <th>{:lang('Author')}</th>
                    <th width="60">{:lang('Status')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="plugins" item="vo">
                    <tr>
                        <td>
                            <input name="list_orders[{$vo.hook_plugin_id}]" type="text" size="3"
                                   value="{$vo.list_order}"
                                   class="input input-order">
                        </td>
                        <td>{$vo.title}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.hooks|default=''}</td>
                        <td>{$vo.description}</td>
                        <td>{$vo.author}</td>
                        <td>
                            <switch name="vo.hook_plugin_status">
                                <case value="0">
                                <span class="badge text-bg-warning">
                                    {$status[$vo['hook_plugin_status']]}
                                </span>
                                </case>
                                <case value="1">
                                <span class="badge text-bg-success">
                                    {$status[$vo['hook_plugin_status']]}
                                </span>
                                </case>
                                <case value="3">
                                <span class="badge text-bg-secondary">
                                    {$status[$vo['hook_plugin_status']]}
                                </span>
                                </case>
                            </switch>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
        </form>
    </div>
</block>
